package com.it.service;

import com.it.dao.UserDao;
import com.it.dao.impl.UserDaoImpl;

public class UserServiceImpl01 implements UserService{
    private String name;
    private String age;

    public UserServiceImpl01(String name, String age) {//满参构造函数注入
        this.name = name;
        this.age = age;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public void add() {
        UserDao userDao = new UserDaoImpl();
        userDao.add();
    }

    public void update() {
        UserDao userDao=new UserDaoImpl();
        userDao.update();
    }

    @Override
    public String toString() {
        return "UserServiceImpl01{" +
                "name='" + name + '\'' +
                ", age='" + age + '\'' +
                '}';
    }
}
